using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TanashCMS.Business;

public partial class manager_publish : CMSManagementPageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {
        PerformPublish();

    }

    private void PerformPublish()
    {
        new TanashCMS.Business.Task.SitePublishTask(mWebsite).WriteXML();

        mWebsite.NeedsPublish = false;
        Configuration.GetCurrentSession().SaveOrUpdate(mWebsite);
        Configuration.GetCurrentSession().Flush();

        panelContent.Visible = false;
        panelFinished.Visible = true;

        // tell the master page to hide the publish link
        ((CMSMasterPageBase)Page.Master).setPublishLinkVisibility(false);
    }


    protected void timerStartPublishing_Tick(object sender, EventArgs e)
    {
        PerformPublish();
    }
}
